<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content=”IE=edge,chrome=1″/>
    <meta name="viewport" content="width=device-width, initial-scale=1, minimum-scale=1, maximum-scale=1, user-scalable=no">
    <title>首页</title>
    <link rel="stylesheet" href="{:C('__STATIC__')}{$theme}/Static/{:C('css')}/common.css"/>
    <link rel="stylesheet" href="{:C('__STATIC__')}{$theme}/Static/{:C('css')}/swiper.css"/>
    <link rel="stylesheet" href="{:C('__STATIC__')}{$theme}/Static/{:C('css')}/index.css"/>
    <script async="async">
        function resize() {
            var clientWidth = document.documentElement.clientWidth;
            document.documentElement.style.fontSize = 100 * (clientWidth / 750  ) + 'px';
        }
        resize();
        window.addEventListener('resize', resize);
    </script>
</head>
<body>

{$htmls}

<p style="height:0.95rem;margin:0;padding:0;"></p>
<div class="footer">
    <ul class="footer-tab">
        <li>
            <a href="{:U('Index/index', array('shop_id'=>session('url_shop_id')))}">
                <i class="foot_bg foot-this"></i>
                <span>首页</span>
            </a>
        </li>
        <li>
            <a href="{:U('Good/cate')}">
                <i class="foot_bg1"></i>
                <span>分类</span>
            </a>
        </li>
        <li>
            <a href="{:U('GoodShopcart/shopcart')}">
                <i class="foot_bg2"></i>
                <span>购物车</span>
            </a>
        </li>
        <li>
            <a href="{:U('Setting/personal')}">
                <i class="foot_bg3"></i>
                <span>我的</span>
            </a>
        </li>
    </ul>
</div>
<script type="text/javascript" src="{:C('__STATIC__')}{$theme}/Static/js/jquery-2.1.4.min.js"></script>
<script src="{:C('__STATIC__')}{$theme}/Static/js/swiper.js"></script>
<script src="__PUBLIC__/js/jquery.SuperSlide.2.1.1.js"></script>
<script type="text/javascript" src="__PUBLIC__/Admin/lib/layer/2.4/layer.js"></script>
<script type="text/javascript">
    var swiper = new Swiper('.swiper-container', {
        pagination: '.swiper-pagination',
        paginationClickable: true,
        spaceBetween: 30,
        centeredSlides: true,
        autoplay: 4000,
        loop: true,
        effect: 'slide',
        autoplayDisableOnInteraction: false
    });
    jQuery(".txtMarquee-top").slide({
        mainCell:".bd ul",
        autoPlay:true,
        effect:"topMarquee",
        vis:1,
        interTime:80
    });
    $(function(){
        $('.cart').click(function() {
            var session = "{:session('user_id')}";
            if(session == ''){
                location.href =  "?m=Home&c=Login&a=index";
            }
            $goods_id = $(this).data('id');
            $.ajax({
                url:"{:U('GoodShopcart/addcart')}",
                data:{good_id: $goods_id, num: 1},
                type:'post',
                success: function (msg) {
                    if(msg == 1) {
                        layer.msg('添加购物车成功！', {icon: 1});
                    }else if(msg == -1){
                        layer.msg("商品信息不存在",{icon:2});
                    }else if(msg == -2){
                        layer.msg("商品数量错误",{icon:2});
                    }else if(msg == -3){
                        layer.msg("商品状态错误",{icon:2});
                    }else if(msg == -4){
                        layer.msg("规格信息错误",{icon:2});
                    }
                }
            });

        });
    });
</script>
</body>
</html>